home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Mania 4
/
MacMania 4.toast
/
/
Demo's
/
Igor Demo Pro
/
1 PutContentsIn Igor Pro Folder
/
WaveMetrics Procedures
/
Image and Contour Plots
/
AppendImageToContour
next >
Wrap
Text File
|
1996-02-27
|
1KB
|
39 lines
#include <Keyword-Value>
| version 1.01
Macro AppendImageToContour(plot,n)
String plot
Variable n=20
Prompt plot,"contour plot",popup,ContourNameList("",";")
Prompt n,"number of rows (and columns) for image"
Silent 1;PauseUpdate
String info=ContourInfo("",plot,0)
String haxis= StrByKey("XAXIS",info)
String vaxis= StrByKey("YAXIS",info)
String xwave= StrByKey("XWAVE",info)
String ywave= StrByKey("YWAVE",info)
String zwave= StrByKey("ZWAVE",info)
String flags= StrByKey("AXISFLAGS",info)
String type=StrByKey("DATAFORMAT",info)
Variable doContourZ= CmpStr(type,"XYZ") == 0
| Make matrix that spans displayed X and Y
String image=zwave
if( doContourZ )
image=CleanupName(image+"Image",1) // not necessarily a unique name
Make/O/N=(n,n) $image // overwrite
GetAxis/Q $haxis
SetScale/I x, V_min, V_max, "",$image
GetAxis/Q $vaxis
SetScale/I y, V_min, V_max, "",$image
$image= ContourZ("",plot,0,x,y)
else // Matrix contour
if( (strlen(xwave) + strlen(ywave)) > 0) // these grid waves won't work with images
Abort "Can't append image because contour grid wave(s) don't work with image plots."
endif
endif
String cmd
sprintf cmd,"AppendImage%s %s",flags,PossiblyQuoteName(image)
Execute cmd
End